package cn.wolfcode.springbootconsumer._03_delay;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 1.自己写一个类去实现RocketMqListener<消息类型>
 * 2.在类上贴上一个@RocketMQMessageListener
 */
@RocketMQMessageListener(
        consumerGroup = "springboot-consumer",
        topic = "send-delay"
)
@Component
public class Consumer3 implements RocketMQListener<String> {
    /**
     * 监听指定的topic如果有消息发送到topic中,消费消息在onMessage
     */
    @Override
    public void onMessage(String msg) {
        System.out.println("消息内容:"+msg);
    }


}
